Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

125
Vistas
How do i remove the div with id="__next" in Next.js

I am making a website with Next.js. I want to have a header with position: sticky; behavior.

However, Next.js automatically generates a div with the attribute id="__next" at the root of my website without my permission.

enter image description here

I need to remove that div so that the position: sticky; behavior of my header can work the way it is expected to do. How can I do that?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

body {
  display: flex;
  min-height: 100vh;
}

#__next {
  flex: 1 1 auto;
}

// do whatever you want here and it'll work as expected
about 4 years ago · Juan Pablo Isaza Denunciar

0

You cannot remove it, next.js needs it to render your web app. position: sticky always look for it's parent element's height. You can assign height: 100%; position: relative; to the __Next id. So, it will work as body. And then, your position sticky will work.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda